﻿@model IEnumerable<sgp.Models.Funcionario>

@{
    ViewBag.Title = "Index";
}

<legend>
<table border="0" width="100%" cellpadding="5">
    <tr>
        <td>
            <h2>Funcionários Cadastrados</h2>
        </td>
    </tr>
    <tr>
        <td>
        <a class="btn btn-primary btn-primary pull-left" href="/Funcionario/Create" data-original-title="">Adicionar</a>
        <td>
    </td>
    </tr>
</table>
</legend>

<table>
@using (Html.BeginForm())
{
    <tr>
        
            <td>
                <div>
                    @Html.DropDownList("setorId", new SelectList(ViewBag.Setor, "Id", "Nome"), "Todos")  
                    <input class="btn btn-info" type="submit" value="Filtrar" />  
                </div>            
            </td>

        
    </tr>
}
</table>


<table class="table table-bordered table-striped" width="100%" cellspacing="0" cellpadding="0" border="0">

   
<tr>
    <th>
        <div>
            Nome
        </div>
    </th>
    <th>
        <div>
            E-Mail
        </div>
    </th>
    <th>
        <div>
            Comunidade/Paroquia
        </div>
    </th>    
    <th>
        Telefone
    
    </th>
    <th>
        Ações    
    </th>

</tr>

@foreach (var item in Model) {   
    
    
    <tr>
        <td>
            <div>
                @Html.DisplayFor(modelItem => item.Nome)
            </div>
        </td>
        <td>
            <div>
                @Html.DisplayFor(modelItem => item.Email)

            </div>
        </td>
        <td>
            <div>
                 @Html.DisplayFor(modelItem => item.Setor.Nome)
            </div>
        </td>       
        
        <td>
            @Html.DisplayFor(modelItem => item.Telefone)
        </td>
                
        
        <td>
            <a class="btn" href="/Funcionario/Edit/@item.Id" data-original-title="Editar"> <i class="icon-edit"></i></a>
            <a class="btn" href="/Funcionario/Details/@item.Id" data-original-title="Detalhar"> <i class="icon-file"></i></a>
            <a class="btn btn-danger" href="/Funcionario/Delete/@item.Id" data-original-title="Deletar"><i class="icon-remove icon-white"></i></a>
        </td>
        

        </tr> 
        
    
}

</table>

